package com.woniuxy.api;

import com.woniu.cloud.common.dto.Result;
import com.woniuxy.form.GetAfterSaleByPlatform;
import com.woniuxy.form.GetOrder;
import com.woniuxy.form.InsertServiceOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "kaer-order",contextId = "ServiceOrderApi")
public interface ServiceOrderApi {
    /**
     *
     * @param insertServiceOrder
     * @return
     * 新增服务订单，同时生成订单详情  删除购物车信息
     *
     */
    @PostMapping("/insertServiceOrder")
    Result insertServiceOrder(@RequestBody InsertServiceOrder insertServiceOrder);

    /**
     *
     * @param serviceOrderId
     * @param status
     * @return
     * 修改服务订单状态 0:未付款 1:已付款 2:已取消 3:已消费
     *
     */
    @PutMapping("/updateServiceOrderStatus")
    Result updateServiceOrderStatus(@RequestParam("serviceOrderId") Integer serviceOrderId,@RequestParam("status") Integer status);

    @PostMapping("/updateServiceOrderPayType")
    Result updateServiceOrderPayType(@RequestParam("orderId") Integer orderId ,@RequestParam("payType") Integer payType);

    @GetMapping("/getServiceOrderById")
    Result getServiceOrderById(@RequestParam("id") Integer id);

    /**
     *
     * @param getOrder 查询条件
     * @return
     *
     * 平台分页查看服务订单
     *
     */
    @GetMapping("/getServiceOrderByPlatform")
    Result getServiceOrderByPlatform(@RequestBody GetOrder getOrder);

    /**
     *
     * @param getOrder 查询条件
     *
     * 店铺分页查看服务订单
     *
     */
    @GetMapping("/getServiceOrderByStore")
    Result getServiceOrderByStore(@RequestBody GetOrder getOrder);

    /**
     *
     * @param getOrder 查询条件
     * @return
     *
     * 用户分页查询服务订单
     *
     */
    @GetMapping("/getServiceOrderByUserId")
    Result getServiceOrderByUserId(@RequestBody GetOrder getOrder);
}
